package wqh.service.impl;

import org.springframework.stereotype.Service;
import wqh.dao.GeoBuildingDao;
import wqh.domain.GeoBuilding;
import wqh.service.GeoBuildingService;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by devts on 2016/9/25.
 */
@Service("geoBuildingService")
public class GeoBuildingServiceImpl implements GeoBuildingService {

    @Resource
    private GeoBuildingDao geoBuildingDao;

    public List<GeoBuilding> findAllRecord() {
        return this.geoBuildingDao.findAllRecord();
    }

    public GeoBuilding findRecordById(Integer id) {
        return this.geoBuildingDao.findRecordById(id);
    }

    public int updateRecord(GeoBuilding geoBuilding) {
        return this.geoBuildingDao.updateRecord(geoBuilding);
    }

    public int insertRecord(GeoBuilding geoBuilding) {
        return this.geoBuildingDao.insertRecord(geoBuilding);
    }

    public int deleteRecord(Integer id) {
        return this.geoBuildingDao.deleteRecord(id);
    }

    public GeoBuilding findAllByParentID(Integer id) {
        return this.geoBuildingDao.findAllByParentID(id);
    }

    public List<GeoBuilding> findAllByNameAndLevel(String name, Byte level) {
        return this.geoBuildingDao.findAllByNameAndLevel(name, level);
    }

    public List<GeoBuilding> findAllByNameAndParentID(String name, Integer parentID) {
        return this.geoBuildingDao.findAllByNameAndParentID(name, parentID);
    }

    public List<GeoBuilding> findAllByNameAndParentIDAndLevel(String name, Integer parentID, Byte level) {
        return this.geoBuildingDao.findAllByNameAndParentIDAndLevel(name, parentID, level);
    }

    public int updateMap(String picture, Integer id) {
        return this.geoBuildingDao.updateMap(picture, id);
    }

    public String findNameById(Integer id) {
        return this.geoBuildingDao.findNameById(id);
    }
}
